using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using TDV.Controles.Base.WinForm;
using BaseDatos.Comun;
using Aplicacion.Base.WinForm;
using BaseDatos;
using System.Data;
using System.Drawing;
using System.Windows.Forms;


namespace SCHD
{
    [ToolboxBitmap(typeof(ComboBox))]
    public partial class CboHDCategoria : BaseComboBox
    {
        #region Campos
        private string codcat = "";
        #endregion

        #region Propiedades
        public string Codigo
        {
            get { return codcat; }
            set { codcat = value; }
        }
        #endregion
        public CboHDCategoria()
        {
            InitializeComponent();
            CargarDatos();
        }

        public CboHDCategoria(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            CargarDatos();
        }
        public void CargarDatos()
        {
            try
            {
                DbParametro[] Parametros = new DbParametro[2];
                Parametros[0] = new DbParametro("pcodcat", codcat);
                Parametros[1] = new DbParametro("popcion", "QRY01");
                DataSet Ds = ConexionBaseDatos.Conexion.CrearDataSet("GETCHDHDCATEGORIA", Parametros);
                DisplayMember = "dsccat";
                ValueMember = "codcat";
                this.DataSource = Ds.Tables[0];
            }
            catch (Exception)
            {
                //throw;
            }
        }
    }
}
